package com.kaifamiao.demo.d0727.pm;

// java.lang.Object 类是所有类的父类
public class Student extends Person{


    public static void main(String[] args) {
        Student stu = new Student();

        stu.name = "张三"; // public
        stu.publicMehtod(); // public
        stu.age = 18; // protected
        stu.protectedMehtod(); // protected
        stu.hobby = "女"; // package-access
        stu.packageAccessMethod(); // package-access

//        stu.money = -1000; // private
//        stu.privateMethod(); // private
    }

    // 重载（Overloading）
    public void a(){}

    public void a(int a){}


    // 重写/覆盖
    @Override
    public void eat(){
        System.out.println("吃火锅");
    }

}
